package com.bjsj.pro.bean;

import android.webkit.JavascriptInterface;

import com.bjsj.pro.interfaces.OnJavaScriptMetodCallBack;

public class JavaScriptMetod {
    private OnJavaScriptMetodCallBack callBack;

    public JavaScriptMetod(OnJavaScriptMetodCallBack callBack) {
        this.callBack = callBack;
    }

    @JavascriptInterface
    public void xbs_callPhone(String phone) {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_callPhone(phone);
        }
    }

    @JavascriptInterface
    public void xbs_copyUrl(String urlStr) {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_copyUrl(urlStr);
        }
    }

    @JavascriptInterface
    public void xbs_getTicket() {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_getTicket();
        }
    }

    @JavascriptInterface
    public void xbs_getUserInfoRequest() {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_getUserInfoRequest();
        }
    }

    @JavascriptInterface
    public void xbs_changeTitle(String title) {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_changeTitle(title);
        }
    }

    @JavascriptInterface
    public void xbs_uploadPhoto(String json) {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_uploadPhoto(json);
        }
    }

    @JavascriptInterface
    public void xbs_logout() {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_logout();
        }
    }

    @JavascriptInterface
    public void xbs_orderPay(String apppayrequest) {
        //关闭当前界面
        if (callBack != null) {
            callBack.xbs_orderPay(apppayrequest);
        }
    }

    @JavascriptInterface
    public void xbs_startRecord() {
        //开始录制
        if (callBack != null) {
            callBack.xbs_startRecord();
        }
    }

    @JavascriptInterface
    public void xbs_closeRecord() {
        //取消录制
        if (callBack != null) {
            callBack.xbs_closeRecord();
        }
    }

    @JavascriptInterface
    public void xbs_stopRecord(String json) {
        //录制完成
        if (callBack != null) {
            callBack.xbs_stopRecord(json);
        }
    }
}
